home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990: Discy Business / Discy Business.2mg / DEV.CD / TOOLS / TECH.NOTES / IIGS / TN.IIGS.083 < prev   
Encoding:
Text File  |  1990-04-25  |  2.0 KB  |  48 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. Apple IIgs
  7. #83:    Resource Manager Stuff
  8.  
  9. Written by:    Dave Lyons                                            May 1990
  10.  
  11. This Technical Note discusses how to open a shell application's resource fork 
  12. and clarifies the meaning of NIL in resource maps.
  13. _____________________________________________________________________________
  14.  
  15. Calling StartUpTools From a Shell Application (File Type $B5, EXE)
  16.  
  17. StartUpTools tries to open the current application's resource fork.  It 
  18. determines the pathname of the "current application" by examining prefix 9: 
  19. and making a GET_NAME GS/OS call, but do not assume it will always construct 
  20. the pathname this way.  If you call StartUpTools from a shell application and 
  21. expect it to open your EXE file's resource fork, you will be disappointed.
  22.  
  23. If GS/OS has launched your application, life is good--usually, though, a shell 
  24. has loaded your shell application directly, so GET_NAME returns the name of 
  25. the shell instead of the name of your application file.
  26.  
  27. To open your shell file's resource fork, call ResourceStartUp, get the 
  28. pathname by calling LGetPathname2 on your user ID, and pass the pathname to 
  29. OpenResourceFile.
  30.  
  31.  
  32. What's NIL in a Resource Map?
  33.  
  34. The resource maps for open resource files are kept in memory, and the 
  35. structure is defined in chapter 45 of Apple IIgs Toolbox Reference, Volume 3.
  36.  
  37. The resHandle field of a resource reference record (ResRefRec) is defined as 
  38. "Handle of resource in memory.  A NIL value indicates that the resource has 
  39. not been loaded into memory."  In this case, NIL means that the middle two 
  40. bytes of the four-byte field are zero.  In other words, a NIL entry in the 
  41. resource map may have a non-zero value in the low-order byte.
  42.  
  43.  
  44. Further Reference
  45. _____________________________________________________________________________
  46.   o  Apple IIgs Toolbox Reference, Volume 3
  47.  
  48.